# 百钱买百鸡

'''
共有100块钱，需要买100只鸡
公鸡 == 3元
母鸡 == 1元
小鸡 == 0.5元
问: 100块钱买100只鸡，一共有多少种方案
'''
content = 0
num = 0
# 枚举
# for gj in range(0, 34):
#     for mj in range(0, 101):
#         for xj in range(0, 201):
#             content += 1
#             if (gj+mj+xj) == 100 and (gj*3+mj*1+xj/2) == 100:
#                 num += 1
#                 print(f'公鸡：{gj}母鸡：{mj}小鸡：{xj}')
# print(f'共有{num}种买法')
# print(f'循环了{content}次')


for gj in range(0, 34):
    for mj in range(0, (100-3*gj+1)):
        content += 1
        if (gj*3+mj*1+(100-gj-mj)/2) == 100:
            num += 1
            print(f'公鸡：{gj}母鸡：{mj}小鸡：{100-gj-mj}')
            break

print(f'共有{num}种买法')
print(f'循环了{content}次')


